"""
@Date:2022/8/5
@author:Jingyu
@Description：进入长春安全系统各级菜单
@other：
"""
from selenium.webdriver.common.by import By



# # 进入一级菜单
# class FirstMenu(object):
#     # 法律法规
#     def smsLaws(self,driver,xpath):
#         driver.find_element(By.XPATH, xpath).click()

class Menu(object):
    # 点击菜单方法
    def clickMenu(self,driver,xpath,name):
        ul = driver.find_element(By.XPATH, xpath)
        li_list = ul.find_elements_by_xpath('li')
        for i in li_list:
            if i.text == name:
                i.click()

    def printMenu(self,driver,xpath):
        ul = driver.find_element(By.XPATH, xpath)
        li_list = ul.find_elements_by_xpath('li')
        for i in li_list:
            print(i.text)



